﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using AllInOne;
using AllInOne.Classes;
using AllInOne.Entity;

namespace AllInOne.Pages
{
    /// <summary>
    /// 制卡操作页面
    /// </summary>
    public partial class IndexDrivingLicencePage : Page
    {
        public IndexDrivingLicencePage()
        {
            InitializeComponent();
        }

        private MainWindow parent;

        public IndexDrivingLicencePage(MainWindow parent)
        {
            InitializeComponent();
            this.parent = parent;
        }

        private void BtnBackToIndex_MouseUp(object sender, MouseButtonEventArgs e)
        {
            this.parent.ResetIndex();
        }

        private void BtnQmhz_MouseUp(object sender, MouseButtonEventArgs e)
        {
            //this.parent.ChooseBusiness(BusinessType.QMHZ);
            this.parent.Choose_Business(EnterBusinessType.LRXXZK);
            //入厂制卡
        }



        private void BtnYsbz_MouseUp(object sender, MouseButtonEventArgs e)
        {
            //this.parent.ChooseBusiness(BusinessType.CCZK);
            this.parent.Choose_Business(EnterBusinessType.CCZK);
        }

        private void BtnShhz_MouseUp(object sender, MouseButtonEventArgs e)
        {
            this.parent.ChooseBusiness(BusinessType.SHHZ);
        }

        /// <summary>
        /// 测试发卡功能
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnCcsl_MouseUp(object sender, MouseButtonEventArgs e)
        {
            this.parent.ChooseBusiness(BusinessType.CeShiFaKaJi);
        }

        private void BtnShouDongFaKa_MouseUp(object sender, MouseButtonEventArgs e)
        {
            MessageBox.Show("暂未开通此功能");
            //this.parent.ChooseBusiness(BusinessType.ShouDongFaKa);
        }

        private void btnRczk_MouseUp(object sender, MouseButtonEventArgs e)
        {
            //BtnQmhz_MouseUp
            //BtnQmhz_MouseUp
            //入厂制卡
            this.parent.Choose_Business(EnterBusinessType.RCZK);
        }

        private void BtnCnzy_MouseUp(object sender, MouseButtonEventArgs e)
        {
            ////厂内转移制卡
            this.parent.Choose_Business(EnterBusinessType.CNLZZK);
            //MessageBox.Show("请选择入厂制卡进行测试");
        }

        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            int UniformGrid_Yang_LieShu = 2;
            if (SystemParam.HideInnerButtonPage)//是否隐藏厂内流转货物制卡
            {
                btnCnzy.Visibility = Visibility.Collapsed;
                sp_ZK_CNLZHW.Visibility = Visibility.Collapsed;                
            }
            else
            {
                UniformGrid_Yang_LieShu++;
                btnCnzy.Visibility = Visibility.Visible;
                sp_ZK_CNLZHW.Visibility = Visibility.Visible;
            }

            if (SystemParam.HideYJTButtonPage)//是否隐藏阴极铜制卡
            {
                btnYJTHWZK.Visibility = Visibility.Collapsed;
                sp_ZK_YJTZK.Visibility = Visibility.Collapsed;
            }
            else
            {
                UniformGrid_Yang_LieShu++;
                btnYJTHWZK.Visibility = Visibility.Visible;
                sp_ZK_YJTZK.Visibility = Visibility.Visible;
            }
            UniformGrid_Yang.Columns = UniformGrid_Yang_LieShu;
        }

        private void BtnSmzk_MouseUp(object sender, MouseButtonEventArgs e)
        {
            //入厂货物--扫码制卡
            this.parent.Choose_Business(EnterBusinessType.RCSMXXLR);
        }

        private void BtnYjtzk_MouseUp(object sender, MouseButtonEventArgs e)
        {
            this.parent.Choose_Business(EnterBusinessType.YJTZK);
        }
    }
}
